const sharedPropertyDefiniton = {
    enumerable: true,
    configurable: true,
}

function proxy(target, temp, key, callback) {
    sharedPropertyDefiniton.get = function proxyGetter() {
        return temp[key]
    }
    sharedPropertyDefiniton.set = function proxySetter(val) {
        temp[key] = val
        if (callback) callback()
    }
    Object.defineProperty(target, key, sharedPropertyDefiniton)
}

export default proxy